package edu.towson.cosc.cosc455.fredasamoah.markdowncompiler;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Vector;
public class Compiler {

	/**
	 * @param args
	 */
	static String token;
	static Vector<String> vc = new Vector<String>();
	static StringBuilder fullLine = new StringBuilder();
	public static void main(String[] args) throws IOException, NullPointerException, ClassCastException, CompilerException {
		// TODO Auto-generated method stub
		

		token = "";
		String line;
		if(args[7].contains(".mkd")){
			BufferedReader reader = null;
			try {
				reader = new BufferedReader(new FileReader(args[7]));
				while((line = reader.readLine())!=null){
					fullLine.append(line);
				}
			}
			catch (IOException e){
				e.printStackTrace();
			}
			MySyntaxAnalyzer taxman = new MySyntaxAnalyzer();
			taxman.document();
		}
		else{
			System.out.println("The file at the path " + args[0] + " is not a .mkd file");
		}
		MySemanticAnalyzer senny = new MySemanticAnalyzer();
		senny.semantics();
		
		//System.out.println(fullLine);
		//System.out.println(Compiler.fullLine.length());
		//1. Check to make sure args are correct.
		//2. Check to make sure the file has an mkd extension. --> endswith(".mkd"); blah
		//3. inits
		//4. Call the lexical analyzer to get the first token set
		//5. Call the start state of the parser, i.e., document();
		
		//...lexer and parser gets down
		
		//6. Call the semantic analyzer
		//7. Write the output file to html
		//8. Clean up
		
	}
}
